<?php
/**
 * Created by PhpStorm.
 * @User: 王崇全
 * @Date: 2019/1/2 14:12
 */


/*//  ftp://fhh_ronmei_net:MmZPaibCbNGMTMhE@120.24.0.243:21/lesion/

//设置返回数据的形式为json
header('Content-type: application/json');

// 允许任意域名发起的跨域请求
header("Access-Control-Allow-Origin: *");

header('Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With,X_Requested_With');

//允许访问的方式
header('Access-Control-Allow-Method:GET, POST');

//是否允许请求带有验证信息
header("Access-Control-Allow-Credentials: true");

//在这个时间范围内，所有同类型的请求都将不再发送预检请求而是直接使用此次返回的头作为判断依据
header("Access-Control-Max-Age:".(string)1440 * 60);

//通过设置P3P头来实现跨域访问COOKIE
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');

//设置cookie
setcookie("age", 24, time() + 60 * 60 * 24 * 30);

//获取cookie
var_dump($_COOKIE);

//删除cookie(使之失效)
deleteCookie("age");


function deleteCookie(string $cookieName){
    //真正删除cookie的代码,让cookie过期
    setcookie($cookieName, "", time() - 1);
}



//如果未开启session,则开启
if (session_status() !== PHP_SESSION_ACTIVE) {
    session_start();
}

//获取session
var_dump($_SESSION);

//设置session
$_SESSION["sex"] = "女";

var_dump($_SESSION);

//删除session
unset($_SESSION["sex"]);

var_dump($_SESSION);*/


$str="fhh ";
$str=rtrim($str);
echo ($str)."<br>";
echo strlen($str);


//返回内容
//die(var_export($_REQUEST, true));